home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / os2 / gnucal.zip / gcal_tai.h < prev    next >
C/C++ Source or Header  |  1995-12-17  |  16KB  |  486 lines

  1. #ifndef __GCAL_TAI_H
  2. #  define __GCAL_TAI_H
  3. /*
  4. *  gcal_tai.h:  Machine/target dependent definitions
  5. *
  6. *
  7. *  Copyright (C) 1994, 1995 Thomas Esken
  8. *
  9. *  This software doesn't claim completeness, correctness or usability.
  10. *  On principle I will not be liable for any damages or losses (implicit
  11. *  or explicit), which result from using or handling my software.
  12. *  If you use this software, you agree without any exception to this
  13. *  agreement, which binds you LEGALLY !!
  14. *
  15. *  This program is free software; you can redistribute it and/or modify
  16. *  it under the terms of the `GNU General Public License' as published by
  17. *  the `Free Software Foundation'; either version 2, or (at your option)
  18. *  any later version.
  19. *
  20. *  You should have received a copy of the `GNU General Public License'
  21. *  along with this program; if not, write to the:
  22. *    Free Software Foundation
  23. *    59 Temple Place, Suite 330
  24. *    Boston, MA 02111-1307  USA
  25. */
  26.  
  27.  
  28.  
  29. /*
  30. *  $Id: gcal_tai.h 0.39 1995/12/17 00:03:09 tom Exp $
  31. */
  32.  
  33.  
  34.  
  35. /*
  36. *  Include definitions (sub)header files  ;<
  37. */
  38. #include "gcal_def.h"
  39. #if HAVE_CONFIG_H
  40. #  include <gcal_cfg.h>
  41. #endif
  42.  
  43.  
  44. /*
  45. *  Detect the machine / os
  46. */
  47. /*
  48. *  Define the symbol MSDOS for MS-DOS machines
  49. */
  50. #if defined(__MSDOS__) || defined(__MSDOS) || defined(_MSDOS)
  51. #  ifndef MSDOS
  52. #    define MSDOS     /* Now let's define the symbol MSDOS generally */
  53. #  endif
  54. #endif
  55. #if defined(__TURBOC__) || defined(__ZTC__) || defined(M_I86)
  56. #  ifndef MSDOS
  57. #    define MSDOS     /* Now let's define the symbol MSDOS generally */
  58. #  endif
  59. #endif
  60. /*
  61. *  Define the symbol OS2 for OS/2 machines
  62. */
  63. #if defined(__OS2__) || defined(__OS2) || defined(_OS2)
  64. #  ifndef OS2
  65. #    define OS2       /* Now let's define the symbol OS2 generally */
  66. #  endif
  67. #endif
  68. /*
  69. *  Microsoft-C or Borland-C or Waterloo-C under OS/2
  70. */
  71. #if defined(OS2)
  72. #  if defined(MSDOS) || defined(__TURBOC__)
  73. #    ifdef MSDOS
  74. #      undef MSDOS
  75. #    endif
  76. #  endif
  77. #endif
  78. /*
  79. *  Define the symbol LINUX for Linux machines
  80. */
  81. #if defined(__LINUX__) || defined(__LINUX) || defined(_LINUX) || defined(LINUX)
  82. #  ifndef LINUX
  83. #    define LINUX     /* Now let's define the symbol LINUX generally */
  84. #  endif
  85. #endif
  86. #if defined(__linux__) || defined(__linux) || defined(_linux) || defined(linux)
  87. #  ifndef LINUX
  88. #    define LINUX     /* Now let's define the symbol LINUX generally */
  89. #  endif
  90. #endif
  91. /*
  92. *  Define the symbol UNIX for UN*X machines
  93. */
  94. #if defined(__UNIX__) || defined(__UNIX) || defined(_UNIX)
  95. #  ifndef UNIX
  96. #    define UNIX      /* Now let's define the symbol UNIX generally */
  97. #  endif
  98. #endif
  99. #if defined(__unix__) || defined(__unix) || defined(_unix) || defined(unix)
  100. #  ifndef UNIX
  101. #    define UNIX      /* Now let's define the symbol UNIX generally */
  102. #  endif
  103. #endif
  104. #ifdef MSDOS
  105. #  ifdef UNIX
  106. #    if defined(__GNUC__) || defined(__GO32__)
  107. #      ifndef DJG
  108. #        define DJG   /* Now let's define the symbol DJG (DJ-GCC under MSDOS) for these machines */
  109. #      endif
  110. #      undef MSDOS
  111. #    endif
  112. #  else /* !UNIX */
  113. #    if defined(__i386) || defined(i386)
  114. #      ifndef SCO
  115. #        define SCO   /* Now let's define the symbol SCO for these machines, too */
  116. #      endif
  117. #      define UNIX    /* Now let's define the symbol UNIX for these machines, too */
  118. #      undef MSDOS
  119. #    endif
  120. #  endif /* !UNIX */
  121. #else /* !MSDOS */
  122. #  if (!defined(LINUX) && defined(__i386)) || defined(i386)
  123. #    ifndef SCO
  124. #      define SCO     /* Now let's define the symbol SCO for these machines, too */
  125. #    endif
  126. #  endif
  127. #endif /* !MSDOS */
  128.  
  129.  
  130.  
  131. /*
  132. *  Target specific predefines
  133. */
  134. #if defined(MSDOS) || defined(DJG) || defined(WIN32)
  135. #  define  STDC_HEADERS 1
  136. #  define  HAVE_ASSERT_H 1
  137. #  define  HAVE_CTYPE_H 1
  138. #  define  HAVE_ISDIGIT 1
  139. #  define  HAVE_ISALNUM 1
  140. #  define  HAVE_UPPER_LOWER 1
  141. #  define  HAVE_STRTOL 1
  142. #  define  HAVE_STRSTR 1
  143. #  define  HAVE_TIME_T 1
  144. #  define  HAVE_VOID 1
  145. #  ifdef DJG
  146. #    define  HAVE_UNISTD_H 1
  147. #    define  DIR2_SEP      "/"         /* Directory/folder separator */
  148. #  else /* !DJG */
  149. #    include <io.h>
  150. #  endif /* !DJG */
  151. #  if USE_PAGER
  152. #    define  SCREEN_ROWS   25          /* Default number of terminal rows */
  153. #  endif
  154. #  define  DIR_SEP       "\\"        /* Directory/folder separator */
  155. #  define  PATH_SEP      ";"         /* Path separator */
  156. #  define  ENV_VAR_DPATH "PATH"      /* Name of data search path environment variable */
  157. #elif defined(OS2)
  158. #  define  STDC_HEADERS 1
  159. #  define  HAVE_ASSERT_H 1
  160. #  define  HAVE_CTYPE_H 1
  161. #  define  HAVE_ISDIGIT 1
  162. #  define  HAVE_ISALNUM 1
  163. #  define  HAVE_UPPER_LOWER 1
  164. #  define  HAVE_STRTOL 1
  165. #  define  HAVE_STRSTR 1
  166. #  define  HAVE_TIME_T 1
  167. #  define  HAVE_VOID 1
  168. #  include <io.h>
  169. #  if USE_PAGER
  170. #    define  SCREEN_ROWS   25          /* Default number of terminal rows */
  171. #  endif
  172. #  define  DIR_SEP       "\\"        /* Directory/folder separator */
  173. #  define  PATH_SEP      ";"         /* Path separator */
  174. #  define  ENV_VAR_DPATH "DPATH"     /* Name of data search path environment variable */
  175. #  ifdef __GNUC__
  176. #    define  ENV_VAR_TCAP  "TERMCAP"      /* Env-var holding path to termcap data base file */
  177. #    define  FNAME_TCAP    "termcap.dat"  /* Name of termcap database file */
  178. #    define  DFLT_TERM     "ansi"         /* Name of default terminal type */
  179. #  endif
  180. #elif defined(ACORN)
  181. #  define  STDC_HEADERS 1
  182. #  define  HAVE_ASSERT_H 1
  183. #  define  HAVE_CTYPE_H 1
  184. #  define  HAVE_ISDIGIT 1
  185. #  define  HAVE_ISALNUM 1
  186. #  define  HAVE_UPPER_LOWER 1
  187. #  define  HAVE_STRTOL 1
  188. #  define  HAVE_STRSTR 1
  189. #  define  HAVE_TIME_T 1
  190. #  define  HAVE_VOID 1
  191. #  define  PATH_SEP      ","         /* Path separator */
  192. #  define  ENV_VAR_PATH  "Run$Path"  /* Name of program search path environment variable */
  193. #  define  ENV_VAR_DPATH "Run$Path"  /* Name of data search path environment variable */
  194. #  ifdef __GNUC__
  195. #    define  HAVE_UNISTD_H 1
  196. #  endif
  197. #elif defined(AMIGA)
  198. #  define  STDC_HEADERS 1
  199. #  define  HAVE_ASSERT_H 1
  200. #  define  HAVE_CTYPE_H 1
  201. #  define  HAVE_ISDIGIT 1
  202. #  define  HAVE_ISALNUM 1
  203. #  define  HAVE_UPPER_LOWER 1
  204. #  define  HAVE_STRTOL 1
  205. #  define  HAVE_STRSTR 1
  206. #  define  HAVE_TIME_T 1
  207. #  define  HAVE_VOID 1
  208. #  ifdef __GNUC__
  209. #    define  HAVE_UNISTD_H 1
  210. #  endif
  211. #elif defined(ATARI)
  212. #  ifdef __GNUC__
  213. #    ifndef STDC_HEADERS
  214. #      define  STDC_HEADERS 1
  215. #    endif
  216. #    define  HAVE_UNISTD_H 1
  217. #  else
  218. #    define  STDC_HEADERS 1
  219. #  endif /* !__GNUC__ */
  220. #  define  HAVE_ASSERT_H 1
  221. #  define  HAVE_CTYPE_H 1
  222. #  define  HAVE_ISDIGIT 1
  223. #  define  HAVE_ISALNUM 1
  224. #  define  HAVE_UPPER_LOWER 1
  225. #  define  HAVE_STRTOL 1
  226. #  define  HAVE_STRSTR 1
  227. #  define  HAVE_TIME_T 1
  228. #  define  HAVE_VOID 1
  229. #  define  DIR_SEP       "\\"        /* Directory/folder separator */
  230. #  define  PATH_SEP      ","         /* Path separator */
  231. #elif defined(__50SERIES)            /* Prime/PRIMOS */
  232. #  define  STDC_HEADERS 1
  233. #  define  HAVE_ASSERT_H 1
  234. #  define  HAVE_CTYPE_H 1
  235. #  define  HAVE_ISDIGIT 1
  236. #  define  HAVE_ISALNUM 1
  237. #  define  HAVE_UPPER_LOWER 1
  238. #  define  HAVE_STRTOL 1
  239. #  define  HAVE_STRSTR 1
  240. #  define  HAVE_TIME_T 1
  241. #  define  HAVE_VOID 1
  242. #  define  DIR_SEP       ">"         /* Directory/folder separator */
  243. #elif defined(VAXC) || defined(VMS)  /* DEC Vax */
  244. #  ifndef UNIX
  245. #    define  UNIX     /* Now let's define the symbol UNIX for default */
  246. #  endif
  247. #  define  STDC_HEADERS 1
  248. #  define  HAVE_ASSERT_H 1
  249. #  define  HAVE_CTYPE_H 1
  250. #  define  HAVE_ISDIGIT 1
  251. #  define  HAVE_ISALNUM 1
  252. #  define  HAVE_UPPER_LOWER 1
  253. #  define  HAVE_STRTOL 1
  254. #  define  HAVE_STRSTR 1
  255. #  define  HAVE_TIME_T 1
  256. #  define  HAVE_VOID 1
  257. #  ifdef VAXC
  258. #    include <unixio.h>
  259. #  endif
  260. #  define  DIR_SEP        "]"        /* Directory/folder separator */
  261. #  define  SUFFIX_SEP     ";"        /* Suffix (version number) separator */
  262. #  define  ENV_VAR_GCAL   "GCAL_OPT" /* Name of programs default options variable */
  263. #else /* default: UNIX */
  264. #  ifndef UNIX
  265. #    define  UNIX     /* Now let's define the symbol UNIX for default */
  266. #  endif
  267. #endif /* default: UNIX */
  268.  
  269.  
  270.  
  271. /*
  272. *  More precise attributes
  273. */
  274. #define  LOCAL           static
  275. #define  PUBLIC       /* Public */
  276. #define  IMPORT          extern
  277. #define  EXPORT          PUBLIC
  278.  
  279.  
  280.  
  281. /*
  282. *  Compiler specific macro for prototyping
  283. */
  284. #ifndef __P_
  285. #  if __STDC__ || defined(__cplusplus) || STDC_HEADERS
  286. #    define  ANSI_PROTO
  287. #    define  __P_(gc_proto)  gc_proto
  288. #  else /* !__STDC__ && !__cplusplus && !STDC_HEADERS */
  289. #    define  __P_(gc_proto)  ()
  290. #  endif /* !__STDC__ && !__cplusplus && !STDC_HEADERS */
  291. #endif
  292.  
  293.  
  294.  
  295. /*
  296.    Action specific preprocessor constants
  297. */
  298. /*
  299.    Termcap action is only allowed for these systems
  300. */
  301. #ifndef DJG
  302. #  if defined(UNIX) || (defined(OS2) && defined(__GNUC__))
  303. #    if HAVE_LIBTERMCAP || HAVE_LIBTERMLIB
  304. #      define  GCAL_TCAP
  305. #    endif
  306. #  endif
  307. #endif
  308. /*
  309. *  Writing a shell script is only allowed on these systems
  310. */
  311. #if defined(UNIX) && !defined(DJG)
  312. #  define  GCAL_SHELL
  313. #endif
  314. /*
  315. *  Using an external pager is only allowed on these systems
  316. */
  317. #if defined(UNIX) && !defined(DJG) && USE_PAGER
  318. #  define  GCAL_EPAGER
  319. #endif
  320. /*
  321.    Email option is only allowed for these systems
  322. */
  323. #if defined(__GNUC__) || defined(UNIX) || defined(OS2) || defined(MSDOS) || defined(DJG) || defined(WIN32)
  324. #  define  GCAL_EMAIL
  325. #endif
  326.  
  327.  
  328.  
  329. /*
  330. *  Target specific preprocessor statements
  331. */
  332. #ifdef GCAL_TCAP
  333. #  ifndef ENV_VAR_TERM
  334. #    define  ENV_VAR_TERM  "TERM"           /* Name of terminal mode/type environment varable */
  335. #  endif
  336. #endif
  337. #ifdef GCAL_SHELL
  338. #  define  SHL_REM       "#"              /* The comment character of the shell */
  339. #  ifndef CHMOD_PRGR
  340. #    define  CHMOD_PRGR    "chmod"          /* Name of default `chmod' program */
  341. #  endif
  342. #  define  CHMOD_OPTS    "+x"            /* Make created shell script executable for all users */
  343. #  if USE_RC
  344. #    define  PRGR_RC_NAME  "."PRGR_NAME"rc" /* Default name of resource file */
  345. #  endif
  346. #else /* !GCAL_SHELL */
  347. #  if USE_RC
  348. #    define  PRGR_RC_NAME  PRGR_NAME"rc"    /* Default name of resource file */
  349. #  endif
  350. #endif /* !GCAL_SHELL */
  351. #if defined(GCAL_SHELL) && HAVE_SYS_INTERPRETER
  352. #  ifndef SHELL
  353. #    define  SHELL         SHL_REM"! /bin/sh"     /* Id for the first line of a shell script */
  354. #  endif
  355. #endif
  356. #ifdef GCAL_EMAIL
  357. #  ifndef REDIRECT
  358. #    define REDIRECT       "<"              /* Input redirection symbol */
  359. #  endif
  360. #  ifndef MAIL_PRGR
  361. #    define  MAIL_PRGR     "mail"           /* Name of default mailer, mostly mail */
  362. #  endif
  363. #endif /* GCAL_EMAIL */
  364. #if USE_PAGER
  365. #  ifndef SCREEN_ROWS
  366. #    define SCREEN_ROWS    24               /* Default number of terminal rows */
  367. #  endif
  368. #  ifndef SCREEN_COLS
  369. #    define  SCREEN_COLS   80               /* Default number of terminal columns */
  370. #  endif
  371. #  ifdef GCAL_EPAGER
  372. #    define  ENV_VAR_PAGER "PAGER"          /* Name of external pager program environment variable */
  373. #    ifndef PAGER_PROG
  374. #      define  PAGER_PROG    "less"           /* Name of first default pager program */
  375. #    endif
  376. #    ifndef PAGER2_PROG
  377. #      define  PAGER2_PROG   "more"           /* Name of second default pager program */
  378. #    endif
  379. #  endif /* GCAL_EPAGER */
  380. #endif /* USE_PAGER */
  381. #ifndef DIR_SEP
  382. #  define  DIR_SEP       "/"              /* Default directory/folder separator */
  383. #endif
  384. #ifndef PATH_SEP
  385. #  define  PATH_SEP      ":"              /* Default path separator */
  386. #endif
  387. #ifndef ENV_VAR_HOME
  388. #  define  ENV_VAR_HOME  "HOME"           /* Name of home directory environment variable */
  389. #endif
  390. #ifndef ENV_VAR_PATH
  391. #  define  ENV_VAR_PATH  "PATH"           /* Name of program search path environment variable */
  392. #endif
  393. #ifndef ENV_VAR_DPATH
  394. #  define  ENV_VAR_DPATH "GCALPATH"       /* Name of data search path environment variable */
  395. #endif
  396. #ifndef ENV_VAR_GCAL
  397. #  define  ENV_VAR_GCAL  "GCAL"           /* Name of programs default options variable */
  398. #endif
  399. #ifndef ENV_VAR_GCALANSI
  400. #  define  ENV_VAR_GCALANSI  "GCALANSI"   /* Name of variable for setting ANSI-sequences to default */
  401. #endif
  402. /*
  403. *  Now define the user- and system library directories of gcal's resource files
  404. */
  405. #if USE_RC
  406. #  ifndef  GCAL_USR_LIBDIR
  407. #    define  GCAL_USR_LIBDIR  "lib"DIR_SEP"gcal-lib"                      /* relative to $HOME dir */
  408. #  endif
  409. #  ifndef  GCAL_SYS_LIBDIR
  410. #    define  GCAL_SYS_LIBDIR  DIR_SEP"usr"DIR_SEP"lib"DIR_SEP"gcal-lib"   /* absolute to root dir */
  411. #  endif
  412. #endif /* USE_RC */
  413.  
  414.  
  415.  
  416. /*
  417. *  Define the lower case representation of the german `umlaute'
  418. */
  419. #if USE_EASC
  420. #  if USE_GER && defined(LINUX)
  421. #    define  AE          "\344"   /* \xe4 */
  422. #    define  OE          "\366"   /* \xf6 */
  423. #    define  UE          "\374"   /* \xfc */
  424. #    define  SZ          "\337"   /* \xdf */
  425. #    define  AAE         "\304"   /* \xc4 */
  426. #    define  OOE         "\326"   /* \xd6 */
  427. #    define  UUE         "\334"   /* \xdc */
  428. #  else /* !USE_GER || !LINUX */
  429. #    define  AE          "\204"   /* \x84 */
  430. #    define  OE          "\224"   /* \x94 */
  431. #    define  UE          "\201"   /* \x81 */
  432. #    define  SZ          "\341"   /* \xe1 */
  433. #    define  AAE         "\216"   /* \x8e */
  434. #    define  OOE         "\231"   /* \x99 */
  435. #    define  UUE         "\232"   /* \x9a */
  436. #  endif /* !USE_GER || !LINUX */
  437. #else /* !USE_EASC */
  438. #  define  AE          "\"a"
  439. #  define  OE          "\"o"
  440. #  define  UE          "\"u"
  441. #  define  SZ          "\"s"
  442. #  define  AAE         "\"A"
  443. #  define  OOE         "\"O"
  444. #  define  UUE         "\"U"
  445. #endif /* !USE_EASC */
  446.  
  447.  
  448.  
  449. /*
  450. *  Define the default highlighting sequences
  451. */
  452. #if USE_EASC
  453. #  define  BUF_HLS1S    "\021"       /* \x11 Highlighting sequence 1 start (current day) */
  454. #  define  BUF_HLS1E    "\020"       /* \x10 Highlighting sequence 1 end (current day) */
  455. #  define  BUF_HLS2S    "\256"       /* \xae Highlighting sequence 2 start (holiday) */
  456. #  define  BUF_HLS2E    "\257"       /* \xaf Highlighting sequence 2 end (holiday) */
  457. #else /* !USE_EASC */
  458. #  define  BUF_HLS1S    "<"          /* Highlighting sequence 1 start (current day) */
  459. #  define  BUF_HLS1E    ">"          /* Highlighting sequence 1 end (current day) */
  460. #  define  BUF_HLS2S    ":"          /* Highlighting sequence 2 start (holiday) */
  461. #  define  BUF_HLS2E    ":"          /* Highlighting sequence 2 end (holiday) */
  462. #endif /* !USE_EASC */
  463. #if USE_HLS
  464. #  if defined(MSDOS) || defined(OS2) || defined(LINUX) || defined(DJG)
  465. #    define  HLS1S        "\033[1m"    /* Highlighting sequence 1 start (current day) */
  466. #    define  HLS2S        "\033[36m"   /* Highlighting sequence 2 start (holiday) */
  467. #  else /* !MSDOS && !OS2 && !LINUX && !DJG */
  468. #    define  HLS1S        "\033[7m"    /* Highlighting sequence 1 start (current day) */
  469. #    define  HLS2S        "\033[1m"    /* Highlighting sequence 2 start (holiday) */
  470. #  endif /* !MSDOS && !OS2 && !LINUX && !DJG */
  471. #  define  HLS1E        "\033[0m"    /* Highlighting sequence 1 end (current day) */
  472. #  define  HLS2E        "\033[0m"    /* Highlighting sequence 2 end (holiday) */
  473. #  define  TC_MC_HL1S   "mr"         /* Termcap mode character HL 1 start (current day) */
  474. #  define  TC_MC_HL1E   "me"         /* Termcap mode character HL 1 end (current day) */
  475. #  define  TC_MC_HL2S   "md"         /* Termcap mode character HL 2 start (holiday) */
  476. #  define  TC_MC_HL2E   "me"         /* Termcap mode character HL 2 end (holiday) */
  477. #else /* !USE_HLS */
  478. #  define  HLS1S        BUF_HLS1S    /* Highlighting sequence 1 start (current day) */
  479. #  define  HLS1E        BUF_HLS1E    /* Highlighting sequence 1 end (current day) */
  480. #  define  HLS2S        BUF_HLS2S    /* Highlighting sequence 2 start (holiday) */
  481. #  define  HLS2E        BUF_HLS2E    /* Highlighting sequence 2 end (holiday) */
  482. #endif /* !USE_HLS */
  483. #define  TC_MC_MAX    4            /* Maximum number of termcap mode chars/single HL sequences used */
  484. #define  NO_HLS       " "          /* Print blank character if highlighting is disabled */
  485. #endif /* __GCAL_TAI_H */
  486.